<?php
/**
 * Created by PhpStorm.
 * User: kb130
 * Date: 2017/8/21
 * Time: 14:02
 */

namespace util\validate\rules;

/**
 * 验证值必须是yes, on, 1, true
 * 在同意协议时很方便
 * Class Accepted
 * @package validate\rules
 */
class Accepted extends BaseRule
{

    public function verify()
    {
        if (0 === strcmp($this->value, 'yes') || 0 === strcmp($this->value, 'on') || '1' == $this->value) {
            return true;
        }

        return false;
    }
}